home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 6501 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: lou.teclink.net!usenet
  2. From: rad@teclink.net (rad)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: pointer conversion error
  5. Date: 29 Mar 1996 04:42:10 GMT
  6. Organization: TECLink Internet Services: info@TECLink.Net
  7. Message-ID: <1539.6661T1230T1038@teclink.net>
  8. References: <19960325.7D4A7F8.6B80@mojaveg.ridgecrest.ca.us>
  9. NNTP-Posting-Host: tc3_62.teclink.net
  10. X-Newsreader: THOR 2.2 (Amiga;TCP/IP) *UNREGISTERED*
  11.  
  12. On 25-Mar-96 15:23:18, Everett M. Greene <mojaveg@mojaveg.ridgecrest.ca.us>
  13. wrote:
  14. >In article <Pine.A32.3.91.960324124636.16067A-100000@red.weeg.uiowa.edu>
  15. >       The Amorphous Mass <robinson@blue.weeg.uiowa.edu> writes:
  16. >> On 24 Mar 1996, Adam Atkinson wrote:
  17. >>
  18. >> > my c compiler (SAS/C version 6.56) creates a warning about the following:
  19. >> >
  20. >> >                         printf("%u %u %u \n", i, l, h);
  21. >> >
  22. >> > three.c 36 Warning 104: conversion from pointer to const/volatile to
  23. >> > pointer to non-const/volatile
  24. >> > What am I doing wrong? i,l and h are unsigned longs.
  25. >>
  26. >>  That's a very curious error.  The problem seems to be that you're passing
  27. >> longs to printf and telling printf that they're ints.  Try using %lu
  28. >> instead  of %u.
  29.  
  30. >Notice that it's not an error, only a warning.  i, l, or h has been
  31. >defined as const?
  32.  
  33. I can think of a few things that may cause this error.  First you need to
  34. include stdio.h.  Did you include this header?  Second did you declare a
  35. prototype for printf?  If so it should be as follows:
  36.  
  37.    int printf (const char*, ...);
  38.  
  39. I don't enough of the original text to tell if either of these is the case.
  40.  
  41. ---------------------------------------------------------------------------
  42. - Richard Deken                         EMail: (personal) rad@teclink.net -
  43. - VLSI Design Engineer                         (AuE)      rad@aue.com     -
  44. - Advanced Microelectronics             PGP public key available          -
  45. ---------------------------------------------------------------------------
  46.  
  47.